package com.jungle.bfi.dao;

import com.jungle.base.dao.ExtendedJpaRepository;

import com.jungle.bfi.domain.bo.DataDefinitionBo;
import com.jungle.bfi.entity.DataDefinitionPo;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DataDefinitionRepository extends ExtendedJpaRepository<DataDefinitionPo, String> {

    /**
     * 根据场景查询<br>
     * 按data_api,data_path,分组查询
     */
    @Query("select new com.jungle.bfi.entity.DataDefinitionPo(apiId,apiPath) from DataDefinitionPo d where d.scenarioFlag = true group by apiId,apiPath")
    List<DataDefinitionPo> scenarioList(DataDefinitionBo bo);
}
